#### prepare ffmpeg

mkdir /root/ffmpeg_latest

cd /root/ffmpeg_latest/

wget http://47.97.154.103/hls/ffmpeg-4.2.1.tar.gz
wget http://47.97.154.103/hls/lame-3.100.tar.gz
wget http://47.97.154.103/hls/x264-snapshot-20191105-2245.tar.gz
wget http://47.97.154.103/hls/nasm-2.13.03.tar
wget http://47.97.154.103/hls/yasm-1.3.0.tar.gz

cd /root/ffmpeg_latest/

tar -zxvf yasm-1.3.0.tar.gz 
cd yasm-1.3.0
./configure 
make 
make install

cd /root/ffmpeg_latest/

tar -xvf nasm-2.13.03.tar 
cd nasm-2.13.03
./configure 
make
make install

cd /root/ffmpeg_latest/

tar -zxvf x264-snapshot-20191105-2245.tar.gz 
cd x264-snapshot-20191105-2245

./configure --enable-static

make 
make install

cp /usr/local/lib/pkgconfig/x264.pc /lib64/pkgconfig/

cd /root/ffmpeg_latest/

tar -zxvf lame-3.100.tar.gz 
cd lame-3.100

./configure --enable-static --enable-shared=NO
make
make install

cd /root/ffmpeg_latest/

tar -zxvf ffmpeg-4.2.1.tar.gz
cd ffmpeg-4.2.1

./configure --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --enable-version3 --enable-libmp3lame --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --enable-gpl --disable-debug --disable-stripping --enable-runtime-cpudetect --enable-libx264
make 
make install

#########

cd /root/ffmpeg_latest/

wget http://47.97.154.103/hls/1114_conf.tar

tar -xvf 1114_conf.tar

cd 1114_conf

rm -f /etc/nginx/conf.d/default.conf
mv default.conf /etc/nginx/conf.d/

mv cleartempuser.ini /etc/supervisord.d/

rm -f /usr/sbin/anjian.sh
mv anjian.sh /usr/sbin/anjian.sh

#########

cd /root/ffmpeg_latest/

wget http://47.97.154.103/hls/r215-r556.tar
tar -xvf r215-r556.tar 

cd r215-r556

\cp -rf archive/* /home/project/archive/
\cp -rf archive_transcode /home/project/
\cp -rf archive_upload/* /home/project/archive_upload/
\cp -rf zipdownload/* /home/project/zipdownload/

wget http://47.97.154.103/hls/r556-r605.tar
tar -xvf r556-r605.tar 

cd r556-r605

\cp -rf www/* /home/project/archive/

#########

cd /root/ffmpeg_latest/

wget http://47.97.154.103/hls/elva_archive.sql
wget http://47.97.154.103/hls/updatedb.txt

# do not run here

######### prepare sox

yum remove sox -y

yum install gcc-c++ libmad libmad-devel libid3tag libid3tag-devel lame lame-devel flac-devel libvorbis-devel -y

mkdir /usr/local/src/SoX

cd /usr/local/src/SoX/

wget http://47.97.154.103/hls/sox-14.4.2.tar.gz 

tar -zxvf sox-14.4.2.tar.gz 

cd sox-14.4.2

./configure

make -s && make install

# cat updatedb.txt | mysql -u root


